From 310d4367f2483343dda330cd6a706bbb4a1ffc61 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 10 Jul 2006 16:19:24 +0000 Subject: [PATCH] Don't assume that priv->current_page is non-NULL. (#347048, Guillaume 2006-07-10 Matthias Clasen * gtk/gtkassistant.c (gtk_assistant_focus): Don't assume that priv->current_page is non-NULL. (#347048, Guillaume Cottenceau) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ gtk/gtkassistant.c | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 896a27b806..c8c7baa7a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-07-10 Matthias Clasen + * gtk/gtkassistant.c (gtk_assistant_focus): Don't assume + that priv->current_page is non-NULL. (#347048, Guillaume + Cottenceau) + * gtk/gtk.symbols: Add some missing deprecation guards. * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 896a27b806..c8c7baa7a2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2006-07-10 Matthias Clasen + * gtk/gtkassistant.c (gtk_assistant_focus): Don't assume + that priv->current_page is non-NULL. (#347048, Guillaume + Cottenceau) + * gtk/gtk.symbols: Add some missing deprecation guards. * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc. diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index bdbcc6e577..d32fdbf5c5 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -1325,7 +1325,8 @@ gtk_assistant_focus (GtkWidget *widget, if (container->focus_child == priv->action_area) { if (!gtk_widget_child_focus (priv->action_area, direction) && - !gtk_widget_child_focus (priv->current_page->page, direction)) + (priv->current_page == NULL || + !gtk_widget_child_focus (priv->current_page->page, direction))) { /* if we're leaving the action area and the current page hasn't any focusable widget, clear focus and go back to the action area */ @@ -1335,13 +1336,15 @@ gtk_assistant_focus (GtkWidget *widget, } else { - if (!gtk_widget_child_focus (priv->current_page->page, direction) && + if ((priv->current_page == NULL || + !gtk_widget_child_focus (priv->current_page->page, direction)) && !gtk_widget_child_focus (priv->action_area, direction)) { /* if we're leaving the current page and there isn't nothing focusable in the action area, try to clear focus and go back to the page */ gtk_window_set_focus (GTK_WINDOW (widget), NULL); - gtk_widget_child_focus (priv->current_page->page, direction); + if (priv->current_page != NULL) + gtk_widget_child_focus (priv->current_page->page, direction); } } -- 2.30.2